import { launchImageLibrary } from 'react-native-image-picker';

export const getLaunchImageLibrary = (mediaType = "mixed", selectionLimit = 1) => {
    return new Promise((resolve, reject) => {
        launchImageLibrary({
            mediaType,
            quality: 0.5,
            videoQuality: 'low',
            includeBase64: true,
            selectionLimit,
        }, res => {
            if (res.didCancel) {
                return reject(false);
            } else {
                return resolve(res.assets)
            }
        })
    });
}